"""
URL configuration for CNAS1 project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from app.views import views, dwy,account, tools

urlpatterns = [
    path('admin/', admin.site.urls),
    path('login/', account.login, name='login'),
    path('register/', account.register, name='register'),
    path('logout/', account.logout, name='logout'),

    # 用户管理路由
    path('user/', account.user_list, name='user_list'),
    path('user/add/', account.user_add, name='user_add'),
    path('user/<int:user_id>/edit/', account.user_edit, name='user_edit'),
    path('user/<int:user_id>/delete/', account.user_delete, name='user_delete'),
    path('account/info/', account.account_info, name='account_info'),


    # 工具管理路由
    path('tool/', tools.tool_list, name='tool_list'),
    path('tool/add/', tools.tool_add, name='tool_add'),
    path('tool/<int:tool_id>/edit/', tools.tool_edit, name='tool_edit'),
    path('tool/<int:tool_id>/delete/', tools.tool_delete, name='tool_delete'),

    path('', views.certificate_stats, name='certificate_stats'),
    path('add/', views.add, name='add'),
    path('kfc/', views.kfc, name='kfc'),
    path('list/', views.cal_list, name='cal_list'),

    path('list/<str:type>/<int:pk>/syn/', views.list_syn, name='list_syn'),
    path('list/<str:type>/<int:pk>/view/', views.list_view, name='list_view'),
    path('list/<str:type>/<int:pk>/reject/', views.list_reject, name='list_reject'),

    path('tools/', views.tools, name='tools'),
    path('tool_list/', tools.tool_list, name='tool_manage'),
    path('kfv/', views.kfv, name='kfv'),
    path('ph/', views.PH, name='ph'),
    path('hma/', views.hma, name='HMA'),
    path('lz/', views.lz, name='LZ'),
    path('ddl/', views.ddl, name='DDL'),

    # 证书审批
    path('approve/', views.approve, name='approve'),
    path('approve/<str:type>/<int:pk>/view/', views.approve_view, name='approve_view'),
    path('approve/<str:type>/<int:pk>/report/', views.report, name='report'),
    path('approve/reportbatch/', views.batch_report, name='batch_report'),
    # 滴定仪
    path('dwy/', dwy.dwy, name='dwy'),
    path('ddg/', dwy.ddg, name='ddg'),

    # 证书下载
    path('download/', views.download, name='download'),
    
    # 证书统计
    path('stats/', views.certificate_stats, name='certificate_stats'),

]
